my $file = $ARGV[0];

open Input, "<$file" or die"cannot open $file\n";
open Output, ">test.log" or die "cannot open test.log\n";
$number = 0;
$firstline = 1;
$start = 0;
$end = 0;

$total = 0;

	$ran = 0;
	$noise = -97;
	for($i=0;$i<44;$i++) {
		$ran = rand(10);
		if($ran>9) {
			$tem = $noise-1;
			print Output "$i $tem\n";
		}
		else {
			if($ran<1){
				$tem = $noise+1;
				print Output "$i $tem\n";
			}
			else {
				print Output "$i $noise\n";
			}
		}
	}
$total = $i;
while(<Input>){
	chomp;
	@rs = split;
	
	$length = @rs;
	print "$length\n";

	
	for($i=0;$i<$length-1;$i++) {
			$temp = 0;
			if($rs[$i]>=127) {
				$temp = $rs[$i] - 256 -45;
			}
			else {
				$temp = $rs[$i] -45;
			}
		$dd = $total+$i;
		print Output "$dd $temp\n";
	}
	
}
close Input;
$total = $total +$i;
	$ran = 0;
	$noise = -97;
	for($i=0;$i<44;$i++) {
		$dd = $total+$i;
		$ran = rand(10);
		if($ran>8) {
			$tem = $noise-1;
			print Output "$dd $tem\n";
		}
		else {
			if($ran<2){
				$tem = $noise+1;
				print Output "$dd $tem\n";
			}
			else {
				print Output "$dd $noise\n";
			}
		}
	}
	
close Output;
